package com.thread.sync;

public class TestMainSync3 {

	public static void main(String[] args) {
		final Object a = new Object();
		final Object b = new Object();
		final Object c = new Object();
		PrintRunnableSync ta = new PrintRunnableSync("a", c, a);
		PrintRunnableSync tb = new PrintRunnableSync("b", a, b);
		PrintRunnableSync tc = new PrintRunnableSync("c", b, c);
		
		new Thread(ta).start();
		
		sleep();
		
		new Thread(tb).start();
		
		sleep();
		
		new Thread(tc).start();
	}
	
	private static void sleep(){
		try {
			Thread.sleep(100);
		} catch (InterruptedException e) {
			e.printStackTrace();
		}
	}
}